if Item == nil then
    Item = {}
    Item.__index = Item
end

function Item:new( o )
    o = o or {}
    setmetatable( o, Item )
    return o
end



function Item:Init()
    Item.itemList={}
    Item.ItemQuality={
        common="common",
        rate="rate",
        epic="epic",
        secret_shop="secret_shop",
        artifact="artifact",
        consumable="consumable",
        component="component"
    }
    Item.creepDropList={}
    Item.bossDropList={}
    --table.print(GameRules.G.itemsKV)

    for key,value in pairs(GameRules.G.itemsKV) do
        if table.contains(GameRules.G.banItemsKV,key)~=true then
            if  type(value)=="table"  and  value["ItemRecipe"]~=1 and value["ItemQuality"]~="consumable" then
                if value["ItemQuality"]==Item.ItemQuality.common or value["ItemQuality"]==Item.ItemQuality.component then
                    table.insert(Item.creepDropList,key)
                else
                    table.insert(Item.bossDropList,key)
                end
            end
        end
    end
end

function Item:GetCreepDrop()
    --if(RollPercentage(0.5)) then
    --    return Item.bossDropList[RandomInt(1,#Item.bossDropList)]
    --end
    if(RollPercentage(10)) then
        return Item.creepDropList[RandomInt(1,#Item.creepDropList)]
    end
    return nil
end

function Item:GetBossDrop()
    return Item.bossDropList[RandomInt(1,#Item.bossDropList)]
end